<template>
	<view class="dietDetails" :style="{ paddingTop: paddingHeight + 'px' }">
		<nav-bar title="饮食" backgroundColor="#fff"></nav-bar>
		<view class="header-bar" :style="{ paddingTop: paddingHeight + 'px' }">
			<view class="date_m" @click="showCalendar = true">
				<text>{{ currentSearchTime | dayFn }}</text>
				<u-icon name="arrow-down" color="#1F2434" size="13"></u-icon>
			</view>
			<view class="date_w">
				<view
					class="date-item"
					:class="{ active: weekDayIndex == index }"
					v-for="(item, index) in weekDayList"
					:key="index"
					@click="handleClickWeekDay(item, index)"
				>
					<view class="text">{{
						item.day == today ? '今' : item.weekDay
					}}</view>
					<view class="num">{{ item.day }}</view>
				</view>
			</view>
		</view>
		<view class="circular-box">
			<view class="t-box">
				<view class="item">
					<view class="num">{{
						recommendObj.alreadyEnergyContent | cardVal
					}}</view>
					<view class="item-text">饮食(千卡)</view>
				</view>
				<view class="item circularProgress">
					<view v-if="recommendObj.progressColor">
						<circularProgress
							bgColor="#F3F4F7"
							:isBgShow="true"
							type="circular60"
							:lineWidth="10"
							boxWidth="140"
							boxHeight="140"
							:progressColor="recommendObj.progressColor"
							:fontShow="false"
							:percent="recommendObj.circularProgress"
						>
							<view class="details">
								<view class="item-text">{{
									recommendObj.circularProgressText
								}}</view>
								<view class="num">{{
									recommendObj.circularProgressNum | cardVal
								}}</view>
								<view class="item-text"
									>推荐摄入{{
										recommendObj.energyContent | cardVal
									}}</view
								>
							</view>
						</circularProgress>
					</view>
				</view>
				<view class="item">
					<view class="num">{{ sportExpend | cardVal }}</view>
					<view class="item-text">运动(千卡)</view>
				</view>
			</view>
			<view class="b-box">
				<view class="item">
					<view class="item-text">碳水</view>
					<view class="progress">
						<u-line-progress
							:percentage="
								(recommendObj.alreadyChoContent /
									recommendObj.choContent) *
								100
							"
							:showText="false"
							inactiveColor="#F3F4F7"
							:activeColor="
								progressFn2(
									recommendObj.alreadyChoContent,
									recommendObj.choContent
								).progressColor
							"
							height="7"
						></u-line-progress>
					</view>
					<view class="num">
						<text
							:style="{
								color: progressFn2(
									recommendObj.alreadyChoContent,
									recommendObj.choContent
								).progressColor
							}"
						>
							{{ recommendObj.alreadyChoContent | cardVal }}
						</text>
						/{{ recommendObj.choContent | cardVal }}克</view
					>
				</view>
				<view class="item">
					<view class="item-text">脂肪</view>
					<view class="progress">
						<u-line-progress
							:percentage="
								(recommendObj.alreadyFatContent /
									recommendObj.fatContent) *
								100
							"
							:showText="false"
							inactiveColor="#F3F4F7"
							:activeColor="
								progressFn2(
									recommendObj.alreadyFatContent,
									recommendObj.fatContent
								).progressColor
							"
							height="7"
						></u-line-progress>
					</view>
					<view class="num">
						<text
							:style="{
								color: progressFn2(
									recommendObj.alreadyFatContent,
									recommendObj.fatContent
								).progressColor
							}"
						>
							{{ recommendObj.alreadyFatContent | cardVal }}
						</text>
						/{{ recommendObj.fatContent | cardVal }}克</view
					>
				</view>
				<view class="item">
					<view class="item-text">氨基酸</view>
					<view class="progress">
						<u-line-progress
							:percentage="
								(recommendObj.alreadyProteinContent /
									recommendObj.proteinContent) *
								100
							"
							:showText="false"
							inactiveColor="#F3F4F7"
							:activeColor="
								progressFn2(
									recommendObj.alreadyProteinContent,
									recommendObj.proteinContent
								).progressColor
							"
							height="7"
						></u-line-progress>
					</view>
					<view class="num">
						<text
							:style="{
								color: progressFn2(
									recommendObj.alreadyProteinContent,
									recommendObj.proteinContent
								).progressColor
							}"
						>
							{{ recommendObj.alreadyProteinContent | cardVal }}
						</text>
						/{{ recommendObj.proteinContent | cardVal }}克
					</view>
				</view>
			</view>
		</view>
		<view class="o_e_card" v-for="(item, index) in list" :key="item.key">
			<view class="header">
				<view class="l">
					<view class="icon-box">
						<u-icon size="25" :name="item.url"></u-icon>
						<text class="name">{{ item.name }}</text>
					</view>
					<view class="text"
						>{{
							intakeInfo[item.key] &&
							intakeInfo[item.key].heat | cardVal
						}}
						<text style="color: #9ba2b9" v-if="item.key != 'M4'"
							>/{{
								intakeInfo[item.key + 'R'] &&
								intakeInfo[item.key + 'R'].recommendHeat
									| cardVal
							}}KJ</text
						>
						<text style="color: #9ba2b9" v-else>/--</text>
					</view>
				</view>
				<view class="r" @click="navigateTo(item.type)">
					<u-icon
						size="25"
						name="http://oss.antaimedical.com/images/pro/2025/02/67c028e2e4b0be9d44423450QcbTvacOyJhZ943d052cb0774cf717b8852b37cd44c0.png"
					></u-icon>
				</view>
			</view>
			<view class="card_c">
				<view class="item">
					<view class="text">碳水</view>
					<view class="progress">
						<u-line-progress
							:percentage="
								progressFn(
									item.key,
									'carbohydrate',
									'recommendCarbohydrate'
								).circularProgress
							"
							:showText="false"
							inactiveColor="#F3F4F7"
							:activeColor="
								progressFn(
									item.key,
									'carbohydrate',
									'recommendCarbohydrate'
								).progressColor
							"
							height="7"
						></u-line-progress>
					</view>
					<view class="num"
						>{{
							intakeInfo[item.key] &&
							intakeInfo[item.key].carbohydrate | cardVal
						}}
						<text style="color: #9ba2b9" v-if="item.key != 'M4'"
							>/{{
								intakeInfo[item.key + 'R'] &&
								intakeInfo[item.key + 'R'].recommendCarbohydrate
									| cardVal
							}}克</text
						>
						<text style="color: #9ba2b9" v-else>/--</text>
					</view>
				</view>
				<view class="item">
					<view class="text">脂肪</view>
					<view class="progress">
						<u-line-progress
							:percentage="
								progressFn(item.key, 'fat', 'recommendFat')
									.circularProgress
							"
							:showText="false"
							inactiveColor="#F3F4F7"
							:activeColor="
								progressFn(item.key, 'fat', 'recommendFat')
									.progressColor
							"
							height="7"
						></u-line-progress>
					</view>
					<view class="num"
						>{{
							intakeInfo[item.key] &&
							intakeInfo[item.key].fat | cardVal
						}}
						<text style="color: #9ba2b9" v-if="item.key != 'M4'"
							>/{{
								intakeInfo[item.key + 'R'] &&
								intakeInfo[item.key + 'R'].recommendFat
									| cardVal
							}}克</text
						>
						<text style="color: #9ba2b9" v-else>/--</text>
					</view>
				</view>
				<view class="item">
					<view class="text">蛋白质</view>
					<view class="progress">
						<u-line-progress
							:percentage="
								progressFn(
									item.key,
									'protein',
									'recommendProtein'
								).circularProgress
							"
							:showText="false"
							inactiveColor="#F3F4F7"
							:activeColor="
								progressFn(
									item.key,
									'protein',
									'recommendProtein'
								).progressColor
							"
							height="7"
						></u-line-progress>
					</view>
					<view class="num"
						>{{
							intakeInfo[item.key] &&
							intakeInfo[item.key].protein | cardVal
						}}
						<text style="color: #9ba2b9" v-if="item.key != 'M4'"
							>/{{
								intakeInfo[item.key + 'R'] &&
								intakeInfo[item.key + 'R'].recommendProtein
									| cardVal
							}}克</text
						>
						<text style="color: #9ba2b9" v-else>/--</text>
					</view>
				</view>
			</view>
			<view class="food-box">
				<view
					class="item"
					v-for="(item2, index2) in foodData['a' + (index + 1)]"
					:key="index2"
					@click="handleClickFood(item2, item.type)"
				>
					<view class="name">
						{{ item2.foodName
						}}<text>{{ item2.dietaryTime }}</text></view
					>
					<view class="num">
						{{ item2.heat }}KJ
						<u-icon size="15" name="arrow-right"></u-icon>
					</view>
				</view>
			</view>
		</view>
		<u-popup
			:show="popupShow"
			round="20"
			mode="bottom"
			:safeAreaInsetBottom="true"
		>
			<view class="popup-con">
				<view class="popup-header">
					<view class="l">
						<text>{{ foodObj.foodName }}</text>
						<text>{{ foodObj.energyContentTitle }}KJ/100g</text>
					</view>
					<view class="r" @click="popupShow = false">
						<u-icon size="18" name="close"></u-icon>
					</view>
				</view>
				<view class="popup-box">
					<view class="con">
						<view class="item">
							<view class="t">{{ foodObj.heat || 0 }}</view>
							<view class="b">热量(g)</view>
						</view>
						<view class="item">
							<view class="t">{{
								foodObj.carbohydrate || 0
							}}</view>
							<view class="b">碳水(g)</view>
						</view>
						<view class="item">
							<view class="t">{{ foodObj.fat || 0 }}</view>
							<view class="b">脂肪(g)</view>
						</view>
						<view class="item">
							<view class="t">{{ foodObj.protein || 0 }}</view>
							<view class="b">氨基酸(g)</view>
						</view>
					</view>
					<view class="input-box">
						<view class="input-value">
							<u--input
								type="number"
								fontSize="22"
								border="bottom"
								placeholderStyle="color:#1F2434;font-size:58rpx;"
								@change="handleChangeKJ"
								v-model="foodObj.gram"
								:cursorSpacing="110"
							>
							</u--input>
						</view>
						<view class="text">克</view>
					</view>
					<view class="save-btn" @click="handleSave">确认</view>
				</view>
			</view>
		</u-popup>
		<my-calendar
			:monthNum="24"
			:defaultDate="defaultDate"
			:maxDate="maxDate"
			@confirm="selectDate"
			:minDate="minDate"
			:show="showCalendar"
			color="#545DDE"
			closeOnClickOverlay
			@close="showCalendar = false"
		></my-calendar>
		<my-datetime-picker
			:show="showModal"
			@cancel="showModal = false"
			@confirm="setTime"
			mode="time"
		></my-datetime-picker>
	</view>
</template>

<script>
import {
	findDayDietaryIntake,
	findMealDietaryPage30,
	findNewestRerLevel,
	findSportExpend,
	getFoodEnergy,
	updateDietaryRecord,
	findDietaryRecommend
} from '@/api/index.js'
import myDatetimePicker from '@/components/my-datetime-picker/my-datetime-picker.vue'
import { mapGetters } from 'vuex'
import { weekComputedfn } from '@/utils/utils.js'
import myCalendar from '@/components/myCalendar/myCalendar.vue'
const dayjs = require('@/utils/dayjs.min.js')
export default {
	components: {
		myCalendar,
		myDatetimePicker
	},
	data() {
		return {
			paddingHeight: uni.getStorageSync('navbarHeight'),
			userId: uni.getStorageSync('userId'),
			weekDayList: [],
			today: '',
			weekDayIndex: '',
			defaultDate: [],
			maxDate: null,
			minDate: null,
			currentSearchTime: null, // 当前查询的时间
			showCalendar: false, // 日历控件显示
			showModal: false,
			intakeInfo: {
				M1: null,
				M1R: null,
				M2: null,
				M2R: null,
				M3: null,
				M3R: null,
				M4: null,
				M4R: null,
				MA: null
			},
			list: [
				{
					name: '早餐',
					key: 'M1',
					type: 1,
					url: 'http://oss.antaimedical.com/images/pro/2025/02/67c01d1de4b0d615350f31455V8fSoipJN1Fa3a8c75d87f67b85a17854450f4460d6.png'
				},
				{
					name: '午餐',
					key: 'M2',
					type: 2,
					url: 'http://oss.antaimedical.com/images/pro/2025/02/67c01d2de4b0be9d4442344eBrZQWH8vRfgMce415a9a93792aa849e16b15fdfe1c0e.png'
				},
				{
					name: '晚餐',
					key: 'M3',
					type: 3,
					url: 'http://oss.antaimedical.com/images/pro/2025/02/67c01d3be4b0be9d4442344fUCbVs0GNxpk644b7727a87f18681cebd63e51a84b8a9.png'
				},
				{
					name: '加餐',
					key: 'M4',
					type: 4,
					url: 'http://oss.antaimedical.com/images/pro/2025/02/67c01d4ee4b0d615350f3147eQA2c39OZuQ7d807be4e6a37f889dde93ea8047552c2.png'
				}
			],
			type: '',
			rerLevel: 0,
			sportExpend: 0,
			recommendObj: {},
			foodData: {},
			popupShow: false,
			foodObj: {
				energyContentTitle: '',
				dietaryTime: '00:00',
				foodId: '',
				foodName: '',
				type: '',
				userId: '',
				carbohydrate: '',
				fat: '',
				heat: '',
				picUrl: '',
				protein: '',
				bodyId: '',
				gram: '',
				mealId: '',
				id: null
			}
		}
	},
	computed: {
		...mapGetters({
			userInfo: 'getUserInfo'
		})
	},
	filters: {
		cardVal(val) {
			return val ? val : '0'
		},
		dayFn(val) {
			return dayjs(val).format('YYYY年MM月DD日')
		}
	},
	onLoad() {
		this.weekDayList = weekComputedfn()
		this.today = dayjs().format('DD')
		this.weekDayList.forEach((item, index) => {
			if (this.today == item.day) {
				this.weekDayIndex = index
			}
		})
		// 设置最大搜索时间及最小搜索时间
		let weekDay = dayjs().day() // 获取今天周几
		this.maxDate = dayjs().format('YYYY-MM-DD')
		this.minDate = dayjs(dayjs(this.maxDate).subtract(365, 'day')).format(
			'YYYY-MM-DD'
		)
		this.currentSearchTime = dayjs().format('YYYY/MM/DD')
		this.defaultDate[0] = this.maxDate
	},
	onShow() {
		this.fetchData()
	},
	methods: {
		handleClickWeekDay(item, index) {
			this.currentSearchTime = item.day2
			this.weekDayIndex = index
			this.defaultDate[0] = dayjs(item.day2).format('YYYY-MM-DD')
			this.fetchData()
		},
		// 查询数据
		async fetchData() {
			uni.showLoading({
				title: '加载中...'
			})
			let params = {
				userId: this.userId,
				dietaryTime: this.defaultDate[0]
			}
			await this.getFindDietaryRecommend()
			try {
				const res_3 = await findDayDietaryIntake(params)
				this.intakeInfo = res_3.data
			} catch (e) {
				//TODO handle the exception
				console.log(e)
			}
			this.findMealDietaryPage30()
			uni.hideLoading()
		},
		findMealDietaryPage30() {
			let params = {
				dietaryTime: this.defaultDate[0],
				userId: this.userId
			}
			findMealDietaryPage30(params).then((res) => {
				this.foodData = res.data
			})
		},
		// 营养推荐统计
		async getFindDietaryRecommend() {
			let params = {
				time: this.defaultDate[0],
				bodyId: this.userInfo.bodyId,
				userId: this.userInfo.userId
			}
			// findNewestRerLevel(params).then((res) => {
			// 	this.rerLevel = res.data || 0
			// })
			findSportExpend(params).then((res) => {
				this.sportExpend = res.data || 0
			})
			this.recommendObj = {}
			await findDietaryRecommend(params).then((res) => {
				this.recommendObj = res.data
				this.recommendObj.energyContent =
					this.recommendObj.energyContent.toFixed()
				let num =
					(this.recommendObj.alreadyEnergyContent /
						this.recommendObj.energyContent) *
					100
				if (
					this.recommendObj.alreadyEnergyContent >=
					this.recommendObj.energyContent
				) {
					this.recommendObj.circularProgressText = '摄入超标'
					this.recommendObj.circularProgressNum = (
						this.recommendObj.alreadyEnergyContent -
						this.recommendObj.energyContent
					).toFixed()
					this.recommendObj.progressColor = '#F46666'
					this.recommendObj.circularProgressColor = '#F46666'
				} else if (
					this.recommendObj.alreadyEnergyContent <
					this.recommendObj.energyContent
				) {
					this.recommendObj.circularProgressNum = (
						this.recommendObj.energyContent -
						this.recommendObj.alreadyEnergyContent
					).toFixed()
					this.recommendObj.circularProgressText = '还可摄入'
					this.recommendObj.circularProgressColor = '#23C89E'
					this.recommendObj.progressColor = '#23C89E'
				} else {
					this.recommendObj.circularProgressText = '未检测'
					this.recommendObj.circularProgressColor = '#23C89E'
					this.recommendObj.progressColor = '#23C89E'
				}
				if (num < 1) {
					this.recommendObj.circularProgress = 0
				} else if (num > 100) {
					this.recommendObj.circularProgress = 100
				} else {
					this.recommendObj.circularProgress = num
				}
			})
		},
        // 食物编辑start
		handleClickFood(val, type) {
            console.log("%c Line:628 🥒 val", "color:#b03734", val);
			this.type = type
			this.foodObj = val
			this.foodObj.energyContentTitle = (
				(this.foodObj.heat * 100) /
				this.foodObj.gram
			).toFixed()
			this.popupShow = true
		},
		handleGetFoodEnergy(item) {
			let params = {
				foodId: item.foodId,
				gram: item.gram
			}
			getFoodEnergy(params).then((res) => {
				this.foodObj.heat = res.data.energyContent
				this.foodObj.carbohydrate = res.data.carbohydratesContent
				this.foodObj.fat = res.data.fatContent
				this.foodObj.protein = res.data.proteinsContent
			})
		},
		// 输入克获取食物其他数据
		handleChangeKJ() {
			let params = {
				foodId: this.foodObj.foodId,
				gram: this.foodObj.gram
			}
			uni.$u.debounce(this.handleGetFoodEnergy(params), 500)
		},
		// 添加食物确认按钮
		handleSave() {
			if (!this.foodObj.heat) return
			this.foodObj.type = this.type
			this.foodObj.userId = this.userInfo.userId
			this.foodObj.bodyId = this.userInfo.bodyId
			let params = {
				...this.foodObj,
				dietaryTime: `${this.defaultDate[0]} ${this.foodObj.dietaryTime}:00`
			}
			updateDietaryRecord({ ...params }).then((res) => {
				this.popupShow = false
				this.fetchData()
			})
		},
        // 食物编辑end
		navigateTo(type) {
			this.type = type
			let foodItem = this.foodData['a' + type]
			if (foodItem) {
				uni.navigateTo({
					url: `/pagesA/health/diet/add?type=${this.type}&day=${this.currentSearchTime}&reType=2&dietaryTime=${foodItem[0].dietaryTime}`
				})
				return
			}
			this.showModal = true
		},
		setTime(val) {
			if (this.type != 5) {
				uni.navigateTo({
					url: `/pagesA/health/diet/add?type=${this.type}&day=${this.currentSearchTime}&reType=2&dietaryTime=${val.value}`
				})
			}
			this.showModal = false
		},
		// 选择日期
		selectDate(e) {
			console.log(e)
			let str = dayjs(e[0]).format('YYYY/M/DD')
			this.weekDayList = weekComputedfn(str)
			this.weekDayList.forEach((item, index) => {
				if (str == item.day2) {
					this.weekDayIndex = index
				}
			})
			this.defaultDate[0] = e[0]
			this.currentSearchTime = e[0].replaceAll('-', '/')
			this.fetchData()
			this.showCalendar = false
		},
		progressFn(key, type1, type2) {
			let num = (this.intakeInfo[key] && this.intakeInfo[key][type1]) || 0
			let maxnum =
				(this.intakeInfo[key + 'R'] &&
					this.intakeInfo[key + 'R'][type2]) ||
				0
			let num1 = (num / maxnum) * 100
			let obj = {
				circularProgress: 0,
				progressColor: '#23C89E'
			}
			if (num1 < 1) {
				obj.circularProgress = 0
				obj.progressColor = '#23C89E'
			} else if (num1 > 100) {
				obj.circularProgress = 100
				obj.progressColor = '#F46666'
			} else {
				obj.circularProgress = num1
				obj.progressColor = '#23C89E'
			}
			return obj
		},
		progressFn2(type1, type2) {
			let num = type1
			let maxnum = type2
			let num1 = (num / maxnum) * 100
			let obj = {
				circularProgress: 0,
				progressColor: '#23C89E'
			}
			if (num1 < 1) {
				obj.circularProgress = 0
				obj.progressColor = '#23C89E'
			} else if (num1 > 100) {
				obj.circularProgress = 100
				obj.progressColor = '#F46666'
			} else {
				obj.circularProgress = num1
				obj.progressColor = '#23C89E'
			}
			return obj
		}
	}
}
</script>
<style lang="scss">
page {
	background-color: #fafafa;
	min-height: 100%;

	.u-popup__content {
		border-top-left-radius: 128rpx;
	}

	.u-popup__content__close {
		top: 48rpx !important;
		right: 48rpx !important;

		.u-icon__icon {
			font-size: 28rpx !important;
		}
	}
}
</style>
<style lang="scss" scoped>
.dietDetails {
	padding: 0 20rpx 148rpx;
	.header-bar {
		width: 100%;
		position: fixed;
		left: 0;
		top: 0;
		z-index: 999;
		background-color: #fff;
		padding-bottom: 38rpx;
		.date_m {
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 26rpx;
			color: #1f2434;
			display: flex;
			justify-content: center;
			align-items: center;
			margin: 30rpx auto;
		}
		.date_w {
			padding: 0 40rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			.active {
				border-radius: 64rpx;
				background-color: #1f2434;
				.text {
					color: #fff !important;
				}
				.num {
					background-color: #fff;
				}
			}
			.date-item {
				padding: 12rpx 6rpx 6rpx 6rpx;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 26rpx;
				text-align: center;
				.text {
					color: rgba(31, 36, 52, 0.8);
				}
				.num {
					width: 54rpx;
					height: 54rpx;
					margin-top: 10rpx;
					font-weight: 500;
					color: #1f2434;
					border-radius: 50%;
					background-color: #f3f4f7;
					display: flex;
					justify-content: center;
					align-items: center;
				}
			}
		}
	}
	.circular-box {
		margin-bottom: 20rpx;
		margin-top: 260rpx;
		width: 100%;
		padding: 30rpx;
		box-shadow: none;
		background: #fff;
		border-radius: 16rpx;
		.t-box {
			margin-top: 30rpx;
			min-height: 236rpx;
			display: flex;
			justify-content: space-around;
			align-items: center;
			.num {
				font-weight: 700;
				font-size: 38rpx;
				color: #000000;
				line-height: 48rpx;
				text-align: center;
				font-style: normal;
				text-transform: none;
			}
			.item-text {
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 24rpx;
				color: #5a667e;
				line-height: 48rpx;
				text-align: center;
				font-style: normal;
				text-transform: none;
				white-space: nowrap;
			}
			.circularProgress {
				// width: 150rpx;
				min-width: 280rpx;
				margin-top: -46rpx;
				.details {
					position: absolute;
					left: 50%;
					top: 50%;
					transform: translate(-50%, -50%);
				}
			}
		}
		.b-box {
			border-top: 2rpx solid #eaebee;
			margin-top: -30rpx;
			display: flex;
			justify-content: space-around;
			align-items: center;
			padding-top: 30rpx;
			.item {
				width: 150rpx;
			}
			.num {
				font-weight: 400;
				font-size: 22rpx;
				color: #9ba2b9;
				line-height: 50rpx;
				text-align: left;
				white-space: nowrap;
				text {
					color: #000000;
				}
			}
			.progress {
				padding: 8rpx 0;
			}
			.item-text {
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 24rpx;
				color: #000000;
				line-height: 48rpx;
				text-align: left;
			}
		}
	}
	.o_e_card {
		margin-bottom: 20rpx;
		width: 100%;
		padding: 30rpx;
		box-shadow: none;
		border-radius: 16rpx;
		.header {
			display: flex;
			justify-content: space-between;
			align-items: center;
			.l {
				display: flex;
				align-items: center;
				font-family: PingFang SC, PingFang SC;
				font-weight: 600;
				font-size: 28rpx;
				color: #1f2434;
				.icon-box {
					display: flex;
					justify-content: center;
					align-items: center;
					font-family: PingFang SC, PingFang SC;
					font-weight: 600;
					font-size: 28rpx;
					color: #1f2434;
					.name {
						margin-left: 10rpx;
					}
				}
				.text {
					margin-left: 34rpx;
					font-weight: 400;
					font-size: 24rpx;
				}
			}
		}
		.card_c {
			text-align: left;
			font-size: 26rpx;
			color: #000;
			border-radius: 24rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 44rpx;
			.item {
				display: flex;
				flex-direction: column;
				justify-content: flex-start;
				align-items: flex-start;
				.text {
					font-size: 26rpx;
				}
				.progress {
					width: 134rpx;
					padding: 12rpx 0;
				}
				.num {
					font-size: 24rpx;
					color: #000;
					font-weight: 400;
				}
			}
		}
		.food-box {
			.item {
				background: #f3f4f7;
				border-radius: 12rpx;
				padding: 24rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-top: 20rpx;
				.name {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 26rpx;
					color: #1f2434;
					text-align: left;
					text {
						margin-left: 10rpx;
					}
				}
				.num {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 26rpx;
					color: rgba(31, 36, 52, 0.5);
					line-height: 48rpx;
					text-align: right;
					display: flex;
					justify-content: center;
					align-items: center;
				}
			}
		}
	}
	.popup-con {
		padding: 26rpx 32rpx;
		.popup-header {
			display: flex;
			justify-content: space-between;
			align-items: center;
			.l {
				font-family: PingFang SC, PingFang SC;
				font-weight: 600;
				font-size: 28rpx;
				color: #1f2434;
				text-align: left;
			}
		}
		.popup-box {
			margin: 34rpx auto;
			.con {
				padding: 24rpx;
				background-color: #f3f4f7;
				border-radius: 12rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				.item {
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: center;
					.t {
						font-weight: 500;
						font-size: 32rpx;
						color: #1f2434;
						line-height: 48rpx;
						text-align: center;
					}
					.b {
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 22rpx;
						color: #5a667e;
						line-height: 48rpx;
						text-align: center;
					}
				}
			}
			.input-box {
				display: flex;
				justify-content: center;
				align-items: center;
				margin-top: 56rpx;
				margin-bottom: 80rpx;
				.input-value {
					width: 152rpx;
				}
				.text {
					font-weight: 500;
					font-size: 32rpx;
					color: rgba(31, 36, 52, 0.5);
				}
				/deep/.u-border-bottom {
					border-bottom: 4rpx solid #1f2434 !important;
				}
			}
			.save-btn {
				width: 338rpx;
				height: 85rpx;
				background: #1f2434;
				border-radius: 46rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 28rpx;
				color: #ffffff;
				text-align: center;
				margin: 0 auto;
				display: flex;
				justify-content: center;
				align-items: center;
			}
		}
		.popup-header2 {
			display: flex;
			justify-content: space-between;
			align-items: center;
		}
		.food-item {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 30rpx 0;
			border-bottom: 2rpx solid #f4f4f4;
			.l {
				display: flex;
				flex-direction: column;
				justify-content: center;
				.food-name {
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					font-size: 28rpx;
					color: #1f2434;
					line-height: 38rpx;
					text-align: left;
					margin-bottom: 10rpx;
				}
				.food-kj {
					font-weight: 400;
					font-size: 24rpx;
					color: #1f2434;
					text-align: left;
					.text2 {
						color: #9ba2b9;
					}
				}
			}
			.r {
				width: 54rpx;
				height: 54rpx;
			}
		}
	}
}
</style>
